def add(n):
    result = 0
    while n:
        result = result + n
        n = n - 1
    return result
